﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlMainHomePage.ascx.cs" Inherits="Controls_ControlMainHomePage" %>
<%@ Import Namespace="webapp4U" %>

<script type="text/javascript" language="javascript">
    var maxglobal = 0;
    function pageLoad() {
        //resizediv();
        //alert(maxglobal);        
    }   

  

    function max(a, b, c) {
        var max = 0;
        max = a;
        if (b > max) max = b;
        if (c > max) max = c;
        return max;
    }
    function resizediv() {

        var h1 = document.getElementById("ctl00_ContentPlaceHolder1_ControlMainHomePage1_rptArticle_ctl00_div_item_home").clientHeight;
        var h2 = document.getElementById("ctl00_ContentPlaceHolder1_ControlMainHomePage1_rptArticle_ctl01_div_item_home").clientHeight;
        var h3 = document.getElementById("ctl00_ContentPlaceHolder1_ControlMainHomePage1_rptArticle_ctl02_div_item_home").clientHeight;

        //alert(h1 + "-" + h2 +"-"+ h3);
        maxglobal = max(h1,h2,h3);

        //document.getElementById("ctl00_ContentPlaceHolder1_ControlMainHomePage1_rptArticle_ctl00_div_item_home").style.height = maxglobal + "px";
        //document.getElementById("ctl00_ContentPlaceHolder1_ControlMainHomePage1_rptArticle_ctl01_div_item_home").style.height = maxglobal + "px";
        //document.getElementById("ctl00_ContentPlaceHolder1_ControlMainHomePage1_rptArticle_ctl02_div_item_home").style.height = maxglobal + "px";

       //alert("2 maxglobal : " + maxglobal);
    }
        //window.onresize(resizediv());		
</script>
    
<asp:Repeater runat="server" ID="rptArticle" onitemdatabound="rptArticle_ItemDataBound">
    <ItemTemplate>        
         <!-- Item home -->
          <div id="div_item_home" runat="server" style="height:410px" class="drm_item_home">
              <div class="drm_content_item" style="height:405px">
                  <asp:HyperLink ID="LinkImage" NavigateUrl='<%# Eval("ArticleID","~/Page/Articles/ArticleDetail.aspx?ArticleID={0}")%>' runat="server"><img src="<%=Globals.ApplicationPath %>UserUpload/Articles/<%# Eval("ImageURL") %>" width="289" height="179" /> </asp:HyperLink>
                  
                  <%--<a href="<%=Globals.ApplicationPath%>Page/Articles/ArticleDetail.aspx?ArticleID=<%# Eval("ArticleID")%>"><img src="<%=Globals.ApplicationPath %>UserUpload/Articles/<%# Eval("ImageURL") %>" width="289" height="179"/></a>--%>
                  <div class="magin_all">
                       <p class="title_item"><%# Eval("Title") %></p>
                       <p style="text-align: justify">
                            <%#Eval("Excerpt") %>
                       </p>
                       <p class="linkdetail"><asp:HyperLink ID="linkDetai" NavigateUrl='<%# Eval("ArticleID","~/Page/Articles/ArticleDetail.aspx?ArticleID={0}")%>' runat="server">...<%=ResourceManager.GetString("Detail")%>...</asp:HyperLink></p>
                    
                  </div>
              </div>
          </div>
          <!-- End Item home -->
    </ItemTemplate>
</asp:Repeater>
